<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button id="openDir">打开目录</button>
		<button id="openFile">打开文件</button>
		<button id="saveFile">写入文件</button>
		<script>
			openDir.onclick = async () => {
				const res = await showDirectoryPicker();
				// console.log(res.entries());
				for await (let file of res.entries()) {
					if (file[1].kind === "file") {
						const fileIO = await file[1].getFile();
						console.log(fileIO);
					}
					else {
						console.log(file[1]);
					}
				}
			}
			openFile.onclick = async () => {
				const res = await showOpenFilePicker();
				console.log(res);
			}
			saveFile.onclick = async () => {
				const res = showSaveFilePicker();
				console.log(res);
			}
		</script>
	</body>
</html>